package cc.sbootd2.sbootd2web.service.impl;

import org.springframework.stereotype.Service;
import cc.sbootd2.sbootd2web.dao.NewsMapper;
import cc.sbootd2.sbootd2web.pojo.News;
import cc.sbootd2.sbootd2web.service.NewsService;

import javax.annotation.Resource;
import java.util.List;

@Service("newsService")
public class NewsServiceImpl implements NewsService {

    @Resource
    private NewsMapper newsMapper;


    @Override
    public int save(News news) {
        return newsMapper.save(news);
    }

    @Override
    public int update(News news) {
        return newsMapper.update(news);
    }

    @Override
    public int delete(int id) {
        return newsMapper.delete(id);
    }

    @Override
    public int deleteAll(List<Integer> ids) {
        return newsMapper.deleteAll(ids);
    }

    @Override
    public News getOneNews(int id) {
        return newsMapper.getOneNews(id);
    }

    @Override
    public int getRecordCount(News news) {
        return newsMapper.getRecordCount(news);
    }

    @Override
    public List<News> getNewsListByPage(News news) {
        return newsMapper.getNewsListByPage(news);
    }
}
